printf("This program prints a few integers and reals, to test your implementation of the random number generator (RNG) is okay. Run the program again to check they produce a different set of numbers - if not the RNG is not seeded correctly.\n");
for(i=1;i<=10;++i)
printf("%lf %d\n", randreal(), randint());
printf("Now we print the average of %d floats and integers. If the figures are wildly different from those expected, check the RNG. The integer type must retun a number between 0 and 2^15-1. If It returns one between 0 and 2^31-1, you will need to modify the function randint()\n",k);
for(i=1;i<=MAX;++i)
{
realtype+=randreal();
inttype+=randint();
}
printf("The mean of %d floats was %.4lf. It should have been about 0.5\n", MAX, realtype/MAX);
printf("The mean of %d its was %.4lf. It should have been about 16384\n", MAX, inttype/MAX);